package GradeManager.StudentGradeSystem.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {
//    返回给前端的代码：1表示成功 0表示失败
    private Integer code;
//    返回给前端的信息
    private String msg;
//    返回给前端的数据
    private Object data;
    public static Result success(){
        return new Result(1,"success",null);
    }
    public static Result success(Object data){
        return new Result(1,"success",data);
    }
    public static Result error(String msg){
        return new Result(0,msg,null);
    }
}
